<template>
    
        <div class="block text-center">
     
      <el-carousel height="300px">
        <el-carousel-item  v-for="item in table" :key="item">
          <!-- <h3 class="small justify-center" text="2xl">{{ item }}</h3> -->
          <img  class="pic" :src="imgUrl + item.building_image" alt="">  
        </el-carousel-item>
      </el-carousel>
    </div>
   
    
   
  </template>

<script>
import {getAllBuildings} from '@/api/dormitory'

export default {
  data() {
    return {
      table:[],
      currentDate: new Date(),
      imgUrl:"http://localhost:28080/"
    };
  },
  mounted (){
    getAllBuildings().then(res=>{
      this.table=res.data
    
    })
  },
 
}
</script> 

  
  <style scoped>
  .demonstration {
    color: var(--el-text-color-secondary);
  }
  
  .el-carousel__item h3 {
    color: 000;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;
    text-align: center;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: white;
  }
  
  .el-carousel__item:nth-child(2n + 1) {
    background-color: white;
  }
  .pic{
    width:80%;
    height: 100%;
  }
  </style>
  